package com.wanglei.rdd.transform

import org.apache.spark.{SparkConf, SparkContext}

object Spark02_flatmap {

  def main(args: Array[String]): Unit = {

    //
    val conf = new SparkConf().setMaster("local[2]").setAppName("map")
    val sc = new SparkContext(conf)

    // flatmap
    val rdd = sc.makeRDD(List(
      List(1, 2),
      List(3, 4)
    ))

    rdd.flatMap(
      list => list
    ).collect().foreach(println)

    //
    sc.stop()

  }

}
